package cn.initcap.designpattern.pattern.behavioral.templatemethod;

/**
 * @author initcap
 * @date Created in 2018/9/23 AM9:09.
 */
public class FeCourse extends AbstractCourse {

    private boolean needWriteArticleFlag = false;

    public FeCourse(boolean needWriteArticleFlag) {
        this.needWriteArticleFlag = needWriteArticleFlag;
    }

    @Override
    void packageCourse() {
        System.out.println("提供课程的前端代码");
        System.out.println("提供课程的图片等多媒体");
    }

    /**
     * 将是否编写手记让应用层根据实际情况进行控制。
     *
     * @return true为需要编写手记
     */
    @Override
    protected boolean needWriteArticle() {
        return this.needWriteArticleFlag;
    }
}
